package day12;

import java.io.IOException;

/**
 * Created by kunsb on 2016/10/17.
 */
public class MyExceptionTest {
    public static void main(String[] args) throws IOException {
        MyExceptionTest test = new MyExceptionTest();
        try {
            test.run(0);
        } catch (MyException e) {
            e.printStackTrace();
            System.out.println("他今天不爽。。。");
        }
        System.err.println("xxxxx");
        System.out.println("end...");
    }

    private void run(int i) throws MyException, IOException {
        System.out.println(111111);
        if (i == 0)
            throw new MyException();
        if (i == 2)
            throw new MyRuntimeException();
        if (i == 3)
            throw new IOException();

        System.out.println(222222);
    }
}
